home *** CD-ROM | disk | FTP | other *** search
- /*
- ARTemis (Graphic Editor for FM-TOWNS)
- (c) MATSUUCHI Ryosuke 1992,1993,1994,1995
-
- cmdexit.c
- */
-
-
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
-
- #include "ge.h"
- #include "dispman.h"
-
- /*
- #define itemDoExit 1
- #define itemCancel 2
- */
-
- #include "cmdexit.md"
-
- int commandExit()
- {
- int f_exit = 0;
- menu_disp(&exitmenu);
- for (;;)
- {
- DMdispcsr(ms.x,ms.y);
- do
- {
- ms_get(&ms);
- } while (ms.dx==0 && ms.dy==0 && ms.btn1==OFF && ms.btn2==OFF &&
- key_chk()==0);
- DMerasecsr();
- scrollForCsr(1,1);
- if (ms.btn1 == OFFON)
- {
- int a;
- a = menu_where(ms.x,ms.y,&exitmenu, NULL,NULL,NULL);
- if (a == itemDoExit)
- break;
- else if (a == itemCancel)
- {
- f_exit = -1;
- break;
- }
- else if (a == itemMoveMenu)
- {
- menu_move();
- }
- }
- else if (ms.btn2 == OFFON)
- {
- f_exit = -1;
- break;
- }
- }
- menu_erase();
- return f_exit;
- }
-
- /* end of cmdexit.c */
-